#Include <ScreenCapture.au3>
#Include <Function For Form Dispatchings.au3>
#Include <GuiListBox.au3>

AutoItSetOption("MustDeclareVars", 1)   
Dim Const $sLogName =  "Form Dispatching.Log" 

Common_WriteCurrentFunctionNameToTempTXT($sFormDispatchingFunctionName)

FormDispatching1_1_1()
FormDispatching2_1_1()
FormDispatching3_1_1()
FormDispatching3_2_1()
FormDispatching3_2_2()
FormDispatching3_2_3()
FormDispatching3_3_1()
FormDispatching3_4_2()
FormDispatching3_5_2()
FormDispatching3_5_3()
FormDispatching3_5_4()
FormDispatching3_6_1()
FormDispatching4_1_1()
FormDispatching4_1_3()
FormDispatching4_1_4()
FormDispatching4_1_6()
FormDispatching4_1_7()
FormDispatching4_2_1()
FormDispatching5_1_1()
FormDispatching5_2_1()
FormDispatching5_2_2()
FormDispatching5_2_3()
FormDispatching5_2_4()
FormDispatching5_2_5()
FormDispatching5_2_6()
FormDispatching5_2_7()
FormDispatching5_2_8()
FormDispatching5_2_9()
FormDispatching5_2_10()
FormDispatching5_2_11()
FormDispatching5_3_1()
FormDispatching5_3_2()
FormDispatching5_3_3()
FormDispatching5_4_1()
FormDispatching5_4_3()
FormDispatching5_5_1()
FormDispatching5_6_1()
FormDispatching5_6_2()
FormDispatching5_6_3()
FormDispatching5_6_4()
FormDispatching5_6_5()
FormDispatching5_6_6()
FormDispatching5_6_7()
FormDispatching5_6_8()
FormDispatching5_7_1()
FormDispatching5_7_2()
FormDispatching5_8_3()
FormDispatching6_3_1()
FormDispatching6_3_5()
FormDispatching6_3_6()
FormDispatching6_3_7()
FormDispatching6_4_1()
FormDispatching6_4_2()
FormDispatching6_4_3()
FormDispatching6_4_4()
FormDispatching6_4_5()
FormDispatching6_5_1()
FormDispatching6_6_1()
FormDispatching6_6_2()
FormDispatching6_6_3()
FormDispatching7_1_1()
FormDispatching7_2_1()
FormDispatching7_2_4()
FormDispatching7_2_6()
FormDispatching7_2_7()
FormDispatching7_2_8()
FormDispatching7_2_9()
FormDispatching7_2_10()
FormDispatching7_3_2()
FormDispatching7_3_7()
FormDispatching7_3_11()
FormDispatching7_3_13()

CloseOpenedExcel($oExcel)
Func FormDispatching1_1_1()
	Local $TestCaseID = "1.1.1"  
	$sCusMsg = 'The image is "Form Wizard" winow'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching2_1_1()
	Local $TestCaseID = "2.1.1"  
		$sCusMsg = 'It has "2.1.1" form'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_1_1()
	Local $TestCaseID = "3.1.1"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	Common_SleepTime(4) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, 'Form Wizard')
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_2_1()
	Local $TestCaseID = "3.2.1"  
		$sCusMsg = 'Form "111111111111111111111111111111" is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName("111111111111111111111111111111")
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_2_2()
	Local $TestCaseID = "3.2.2"  
		$sCusMsg = '12 forms has been added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	For $i = 1 to 12
		OpenFormDispatchManagerDlg()
		AddFormName($i)
		AddTemplate($sSampleFolderPath & $i & '.JPG')
		ControlClick("", "",$sNextButton)   ;Next button.
		Common_SleepTime(4)
		ControlClick("", "",$sFinishButton)   ;Finish button.
		Common_SleepTime(6)
		ControlClick($sMessageTitle, '',7)   ;No button.
		Common_SleepTime(2)
	Next
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_2_3()
	Local $TestCaseID = "3.2.3" 
		$sCusMsg = 'First form is selected'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	For $i = 1 to 3
		OpenFormDispatchManagerDlg()
		AddFormName($i)
		AddTemplate($sSampleFolderPath & $i & '.JPG')
		ControlClick("", "",$sNextButton)   ;Next button.
		Common_SleepTime(4)
		ControlClick("", "",$sFinishButton)   ;Finish button.
		Common_SleepTime(6)
		ControlClick($sMessageTitle, '',7)   ;No button.
		Common_SleepTime(2)
	Next
	OpenFormDispatchManagerDlg()
	Local $hListBox = ControlGetHandle($sFormWizardDialogTitle,"",$sFormsListBox)
	_GUICtrlListBox_SelItemRange($hListBox, 1, 3)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_3_1()
	Local $TestCaseID = "3.3.1"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	For $i = 1 to 3
		OpenFormDispatchManagerDlg()
		AddFormName($i)
		AddTemplate($sSampleFolderPath & $i & '.JPG')
		ControlClick("", "",$sNextButton)   ;Next button.
		Common_SleepTime(4)
		ControlClick("", "",$sFinishButton)   ;Finish button.
		Common_SleepTime(6)
		ControlClick($sMessageTitle, '',7)   ;No button.
		Common_SleepTime(2)
	Next
	OpenFormDispatchManagerDlg()
	Local $stateAddNewFormButton = ControlCommand($sFormWizardDialogTitle,"",$sAddNewFormButton,"IsEnabled", "")
	If $sPMVersion = "FE" Then
		If $stateAddNewFormButton Then			
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile& $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		If $stateAddNewFormButton Then			
			Common_WriteLog($sFaile& $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0   
		Else
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1
		EndIf
		
	EndIf
EndFunc

Func FormDispatching3_4_2()
	Local $TestCaseID = "3.4.2"  
		$sCusMsg = 'The imaage is "Select Templates for the Form" window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_5_2()
	Local $TestCaseID = "3.5.2"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sRemoveSelectedFormButton)   ;Remove selected form button.
	Common_SleepTime(4) 
	If WinExists($sMessageTitle) Then
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sMessageTitle)
		Common_SleepTime(2) 
		Send("{esc}")
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		Common_SleepTime(2)
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile&$sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_5_3()
	Local $TestCaseID = "3.5.3"  
		$sCusMsg = 'The image has 1 form'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sRemoveSelectedFormButton)   ;Remove selected form button.
	Common_SleepTime(6)
	ControlClick('','',7)   ;No button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_5_4()
	Local $TestCaseID = "3.5.4"  
		$sCusMsg = 'The image has no form'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sRemoveSelectedFormButton)   ;Remove selected form button.
	Common_SleepTime(6)
	ControlClick('','',6)   ;No button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching3_6_1()
	Local $TestCaseID = "3.6.1" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	ControlClick('','',$sCloseButton)   ;Close button.
	Common_SleepTime(1)
	If WinExists($sFormWizardDialogTitle) Then	
		Common_WriteLog($sFaile& $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	Else
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
	
EndFunc

Func FormDispatching4_1_1()
	Local $TestCaseID = "4.1.1"  
		$sCusMsg = 'The window title contain "111111111111111111111111111111"'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName('111111111111111111111111111111')
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching4_1_3()
	Local $TestCaseID = "4.1.3"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName('\:?*')
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching4_1_4()
	Local $TestCaseID = "4.1.4"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching4_1_6()
	Local $TestCaseID = "4.1.6"  
		$sCusMsg = 'Next button is dimmed'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName(' ')
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching4_1_7()
	Local $TestCaseID = "4.1.7"  
		$sCusMsg = 'The window titile contain "@#$&~"'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName('@#$&~')
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching4_2_1()
	Local $TestCaseID = "4.2.1"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle ,'' ,$sAddNewFormButton)   ;Add new form button.
	Common_SleepTime(2)
	ControlClick($sEnterFormNameDialogTitle,'',2)   ;Add cancel button.
	Common_SleepTime(2)
	If WinExists($sEnterFormNameDialogTitle) Then	
		Common_WriteLog($sFaile& $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1
	Else
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_1_1()
	Local $TestCaseID = "5.1.1" 
		$sCusMsg = 'The window title is Select Templates for the Form - "5.1.1"'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_1()
	Local $TestCaseID = "5.2.1"  
		$sCusMsg = '8 filse should add in template'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $Array[9]
	$Array[0]="0.PDF"
	$Array[1]="1.jpg"
	$Array[2]="2.BMP"
	$Array[3]="3.TIF"
	$Array[4]="4.pcx"
	$Array[5]="5.pct"
	$Array[6]="6.tga"
	$Array[7]="7.png"
	$Array[8]="8.pcd"
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	For $i = 1 to 8
		AddTemplate($sSupportFormatFolderPath & $Array[$i])
	Next	
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_2()
	Local $TestCaseID = "5.2.2" 
		$sCusMsg = '"Suit.jpg" added as template'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_3()
	Local $TestCaseID = "5.2.3"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & 'Not Suit.JPG')
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc
Func FormDispatching5_2_4()
	Local $TestCaseID = "5.2.4"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	AddTemplate($sTemplateSample)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_5()
	Local $TestCaseID = "5.2.5"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName('1')
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	AddFormName('2')	
	AddTemplate($sTemplateSample)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_6()
	Local $TestCaseID = "5.2.6"  
		$sCusMsg = '3 template added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & 'Mulit_p.PDF')
	Common_SleepTime(28)
	Send("{ENTER}")
	Common_SleepTime(20) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_7()
	Local $TestCaseID = "5.2.7" 
		$sCusMsg = 'The image is password window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & '111.PDF')
	Common_SleepTime(4)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_8()
	Local $TestCaseID = "5.2.8" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & '111.PDF')
	Common_SleepTime(2)
	Send('test')
	Common_SleepTime(2)
	Send('{enter}')
	Common_SleepTime(4)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_9()
	Local $TestCaseID = "5.2.9" 
		$sCusMsg = '111.PDF added template'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & '111.PDF')
	Common_SleepTime(2)
	Send('111')
	Common_SleepTime(2)
	Send('{enter}')
	Common_SleepTime(5)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_10()
	Local $TestCaseID = "5.2.10"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & '111.PDF')
	Common_SleepTime(2)
	Send('111')
	Common_SleepTime(2)
	ControlClick('','',$sCancelButton)   ;Click Cancel button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_2_11()
	Local $TestCaseID = "5.2.11"  
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & '111.PDF')
	Common_SleepTime(2)
	Send('111')
	Common_SleepTime(2)
	ControlClick('','',$sCancelButton)   ;Click Cancel button.
	Common_SleepTime(2)
	ControlClick('','',2)   ;Click OK button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_3_1()
	Local $TestCaseID = "5.3.1"
		$sCusMsg = 'The 11111111111111111111111111111111111111111111111111.JPG template is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sSampleFolderPath & '11111111111111111111111111111111111111111111111111.JPG')
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_3_2()
	Local $TestCaseID = "5.3.2"
		$sCusMsg = '15 template is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	For $i = 1 to 15
		AddTemplate($sSampleFolderPath & $i & '.JPG')
	Next
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_3_3()
	Local $TestCaseID = "5.3.3"
		$sCusMsg = '"3.jpg" is selected'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	For $i = 1 to 3
		AddTemplate($sSampleFolderPath & $i & '.JPG')
	Next
	Common_SleepTime(2)
	Local $hSelectT= WinGetHandle("")
	Local $hListBox=ControlGetHandle($hSelectT,"",3067)
	_GUICtrlListBox_SelItemRange($hListBox, 1, 3)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_4_1()
	Local $TestCaseID = "5.4.1" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	Local $hBtn= ControlCommand("", "", $sDeleteTemplateButton,"IsEnabled", "")   ;Delete template button.
	If $hBtn Then	
		Common_WriteLog($sFaile&$sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	Else
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	EndIf
EndFunc

Func FormDispatching5_4_3()
	Local $TestCaseID = "5.4.3" 
		$sCusMsg = 'NO temoplate'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick('','',$sDeleteTemplateButton)   ;Delete button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_5_1()
	Local $TestCaseID = "5.5.1" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_1()
	Local $TestCaseID = "5.6.1"  
		$sCusMsg = 'No template window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick('','',$sCancelButton)   ;Click cancel button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_2()
	Local $TestCaseID = "5.6.2" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2)
	ControlClick('','',1)   ;Click OK button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_3()
	Local $TestCaseID = "5.6.3"  
		$sCusMsg = 'Select template window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2)
	ControlClick('','',$sCancelButton)   ;Click Cancel button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Common_SleepTime(2) 
	Send("{esc}")
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	Common_SleepTime(2)
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_4()
	Local $TestCaseID = "5.6.4"
		$sCusMsg = '5.6.4 form is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_5()
	Local $TestCaseID = "5.6.5"
		$sCusMsg = '5.6.5 form is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()	
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(3)	
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_6()
	Local $TestCaseID = "5.6.6"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()	
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(3)	
	AddTemplate($sSampleFolderPath & '1.JPG')
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_7()
	Local $TestCaseID = "5.6.7" 
		$sCusMsg = 'Select template widnow'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()	
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(3)	
	AddTemplate($sSampleFolderPath & '1.JPG')
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2)
	ControlClick('','',1)   ;Click OK button.
	Common_SleepTime(2)
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_6_8()
	Local $TestCaseID = "5.6.8"
		$sCusMsg =  'Select template widnow'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()	
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(3)	
	AddTemplate($sSampleFolderPath & '1.JPG')
	ControlClick('','',$sBackButton)   ;Click back button.
	Common_SleepTime(2)
	ControlClick('','',$sCancelButton)   ;Click Cancel button.
	Common_SleepTime(2)
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_7_1()
	Local $TestCaseID = "5.7.1" 
		$sCusMsg = 'Form list is blank'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	AddTemplate($sSampleFolderPath & '1.JPG')
	ControlClick('','',$sCancelButton)   ;Click Cancel button.
	Common_SleepTime(2)
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2)			
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage,$sFormWizardDialogTitle)
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_7_2()
	Local $TestCaseID = "5.7.2"
		$sCusMsg = 'No form window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2)	
	ControlClick('','',$sCancelButton)   ;Click Cancel button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching5_8_3()
	Local $TestCaseID = "5.8.3"
		$sCusMsg = 'Select folder wundow'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_1_1()
	Local $TestCaseID = "6.1.1"
		$sCusMsg = 'Select folder wundow'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_2_1()
	Local $TestCaseID = "6.2.1" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2) 
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_3_1()
	Local $TestCaseID = "6.3.1"
		$sCusMsg = '6.3.1 form is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)			
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(2)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_3_5()
	Local $TestCaseID = "6.3.5"
		$sCusMsg = 'Form 6.3.5 is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)			
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(2)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_3_6()
	Local $TestCaseID = "6.3.6"
		$sCusMsg =  'Form 6.3.6 is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	DirCreate($sFunctionFolderPath & '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111')
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)			
	ChangePath("LongPath")
	Common_SleepTime(2)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(2)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	DirRemove($sFunctionFolderPath & '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111', 1)
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_3_7()
	Local $TestCaseID = "6.3.7"
		$sCusMsg ='Form 6.3.7 is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	DirCreate($sFunctionFolderPath & $DoubleByte)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)			
	ChangePath("DoubleBytePath")
	Common_SleepTime(2)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(2)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sFormWizardDialogTitle)
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_4_1()
	Local $TestCaseID = "6.4.1"
		$sCusMsg = 'Select Templates  window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)			
	ControlClick('', '',$sBackButton)   ;Back button.
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_4_2()
	Local $TestCaseID = "6.4.2"
		$sCusMsg = 'Select Templates window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", '',$sNextButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2)	
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)		
	ControlClick('', '',$sBackButton)   ;Back button.
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_4_3()
	Local $TestCaseID = "6.4.3" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2)	
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)		
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick('', '',$sBackButton)   ;Back button.
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_4_4()
	Local $TestCaseID = "6.4.4"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2)	
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)		
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick('', '',$sBackButton)   ;Back button.
	Common_SleepTime(3)	
	ControlClick('', '',1)   ;OK button.
	Common_SleepTime(3)	
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_4_5()
	Local $TestCaseID = "6.4.5"
		$sCusMsg = 'Select folder winodw'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	OpenFormDispatchManagerDlg()
	ControlClick($sFormWizardDialogTitle,'',$sEditSelectedFormButton)   ;Edit selected form button.
	Common_SleepTime(2)	
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)		
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick('', '',$sBackButton)   ;Back button.
	Common_SleepTime(3)	
	ControlClick('', '',2)   ;Cancel button.
	Common_SleepTime(3)	
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_5_1()
	Local $TestCaseID = "6.5.1"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick('', '',2)   ;Cancel button.
	Common_SleepTime(3)	
	If WinExists($sSelectTemplatesforFormTitle&" - 6.5.1") Then
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	Else
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_6_1()
	Local $TestCaseID = "6.6.1"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_6_2()
	Local $TestCaseID = "6.6.2"
		$sCusMsg = 'Form 6.6.2 is added'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)	
	ControlClick('', '',6)   ;Yes button.
	Common_SleepTime(2)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching6_6_3()
	Local $TestCaseID = "6.6.3"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ChangePath("SysDir")
	Common_SleepTime(2)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)	
	ControlClick('', '',7)   ;No button.
	Common_SleepTime(3)	
	If WinExists($sFormWizardDialogTitle) Then
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase) 
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1 
	Else
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_1_1()
	Local $TestCaseID = "7.1.1"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(4)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_1()
	Local $TestCaseID = "7.2.1"
		$sCusMsg = 'Dispatching result window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(4)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_3()
	Local $TestCaseID = "7.2.3" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	FileCopy($sSampleFolderPath & '2.avi', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	ControlListView($hPMHandle, "", $sThumbnailViewCtrInfo, "Select" ,1)
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(4)	
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_4()
	Local $TestCaseID = "7.2.4"
	$sCusMsg = 'form dispatching result window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	FileCopy($sSampleFolderPath & '1.jpg', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	ControlListView($hPMHandle, "", $sThumbnailViewCtrInfo, "Select" ,1)
	Common_SleepTime(1)		
	ControlClick($hPMHandle, "", $sStackButtonInToolbarCtrInfo)
	Common_SleepTime(1)	
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		Common_SleepTime(1)
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
		Common_SleepTime(2) 
		Send("{esc}")
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		Common_SleepTime(2)
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_6()
	Local $TestCaseID = "7.2.6"
	$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sSampleFolderPath & '111.PDF', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	AutoDispath()
	Common_SleepTime(1)	
	Send('aa')
	Common_SleepTime(1)	
	Send('{ENTER}')
	Common_SleepTime(3)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_7()
	Local $TestCaseID = "7.2.7"
		$sCusMsg = 'form dispatching result window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sSampleFolderPath & '111.PDF', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	AutoDispath()
	Common_SleepTime(4)	
	Send('111')
	Common_SleepTime(1)	
	Send('{ENTER}')
	Common_SleepTime(4)	
	Send('111')
	Common_SleepTime(1)	
	Send('{ENTER}')
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		Common_SleepTime(1)
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
		Common_SleepTime(2) 
		Send("{esc}")
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		Common_SleepTime(2)
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_8()
	Local $TestCaseID = "7.2.8"
	$sCusMsg = 'Alert message'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)	
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sSampleFolderPath & '111.PDF', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	AutoDispath()
	Common_SleepTime(1)	
	ControlClick($sPasswordDialogTitle,'',2)   ;Cancel button.
	Common_SleepTime(5)
	Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
	Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
	If $CaptureCompareResult Then			
		Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 1   
	Else
		Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_9()
	Local $TestCaseID = "7.2.9"
		$sCusMsg = 'form dispatching result window'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sSampleFolderPath & 'Multipe.TIF', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		Common_SleepTime(1)
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_2_10()
	Local $TestCaseID = "7.2.10"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sSampleFolderPath & 'Mulit_p.pdf', $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(8)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)	
	AutoDispath()
	Common_SleepTime(8)
	If WinExists($sMessageTitle) Then
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, $sMessageTitle)
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)   
		If $CaptureCompareResult Then
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   	
		Else
			Common_WriteLog($sFaile & $sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile&$sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf	
EndFunc

Func FormDispatching7_3_2()
	Local $TestCaseID = "7.3.2"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		If FileExists($PMFolder & $TestCaseID & "\Suit.JPG") Then	
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0			
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_3_7()
	Local $TestCaseID = "7.3.7" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Local $sSysDir = 'C:\Windows\'
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		SetDispatchResultsPath($sSysDir & $TestCaseID)
		If FileExists($PMFolder & $TestCaseID & "\Suit.JPG") And FileExists($sSysDir & $TestCaseID & ".txt") Then	
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			FileDelete($sSysDir & $TestCaseID & ".txt")
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			FileDelete($sSysDir & $TestCaseID & ".txt")
			Return 0			
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_3_10()
	Local $TestCaseID = "7.3.10"
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		SetDispatchResultsPath($sFunctionFolderPath & '%$#@')
		If FileExists($PMFolder & $TestCaseID & "\Suit.JPG") And FileExists($sFunctionFolderPath & '%$#@'& ".txt") Then	
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0			
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf
EndFunc

Func FormDispatching7_3_11()
	Local $TestCaseID = "7.3.11" 
		$sCusMsg = 'The save as winow'
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		SetDispatchResultsPath('')
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
		Send('{ESC}')
		Local $bCompareFile = Common_CompareFile($PerformResultPath & $sCaptureImage, $CorrectResutPath & $sCaptureImage)  			
		If $bCompareFile Then	
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		EndIf
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf		
EndFunc

Func FormDispatching7_3_12()
	Local $TestCaseID = "7.3.12" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		SetDispatchResultsPath($sSampleFolderPath & '7.3.7.txt')
		Common_ScreenCaprureWindow($PerformResultPath,$sCaptureImage, WinGetHandle(''))
		Local $CaptureCompareResult = Common_CompareFile ($PerformResultPath&$sCaptureImage, $CorrectResutPath&$sCaptureImage)  
		Common_SleepTime(2)
		If $CaptureCompareResult Then			
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile &$sFailLogMsg, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf		
EndFunc

Func FormDispatching7_3_13()
	Local $TestCaseID = "7.3.13" 
		$sCusMsg = ''
	$sFailLogMsg = Common_GetTestStepInSTD($sExcelSheetName,$iCurrentSheetTotalLineNumber,$TestCaseID, $iRescolumn, $sCusMsg)
	Local $bReproduceTestCase = Common_ReproduceRunWithIni($sFormDispatchingFunctionName,$TestCaseID)
	If $bReproduceTestCase = False Then
		Return 3   
	EndIf	
	Local $sTestCaseLevel = Common_GetTestCaseLevel($oExcel, $TestCaseID,$sFormDispatchingFunctionName,$iCurrentSheetTotalLineNumber)   
	Local $bExecuteTestCase = Common_IsTestCaseLevelQualified($sTestCaseLevel)
	If $bExecuteTestCase = False Then
		Return 2   
	EndIf 
	Local $sCaptureImage = $TestCaseID & '.jpg'  
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForFormDispatching()  
	FileCopy($sTemplateSample, $sFunctionFolderPath, 1)
	Local $hPMHandle = Common_Run_PageManager_Ex($TestCaseID, $sTreeViewFunctionName)
	Common_SwitchToFolderInRootDiskC($hPMHandle, $sSectionNameFormDispatching)
	OpenFormDispatchManagerDlg()
	AddFormName($TestCaseID)
	AddTemplate($sTemplateSample)
	ControlClick("", "",$sNextButton)   ;Next button.
	Common_SleepTime(4)
	ControlClick("", "",$sFinishButton)   ;Finish button.
	Common_SleepTime(6)
	ControlClick($sMessageTitle, '',7)   ;No button.
	Common_SleepTime(2)	
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
	Common_SleepTime(1)		
	AutoDispath()
	Common_SleepTime(20)
	If WinWaitActive($sFormDispatchingResults, '' , 10) Then
		SetDispatchResultsPath($PerformResultPath & ' 7.3.13')
		Send('{ESC}')
		
		If FileExists($PMFolder & $TestCaseID & "\Suit.JPG") And FileExists($PerformResultPath & " 7.3.13.txt") Then	
			Common_WriteLog($sPass, $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 1   
		Else
			Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
			Common_Close_PM($hPMHandle) 
			Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
			Return 0			
		EndIf
	Else
		Common_WriteLog($sFaile & $sFailLogMsg , $TestCaseID,$sFormDispatchingFunctionName,$bReproduceTestCase)  
		Common_Close_PM($hPMHandle) 
		Common_WiteTestCaseExecuteRecode($sTempTXTPath,$TestCaseID)
		Return 0
	EndIf		
EndFunc

